home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
shared.dir
/
03024_Script_GO SECTION
< prev
next >
Wrap
Text File
|
1996-06-21
|
13KB
|
423 lines
-- ---------------------------------------------------------------
-- Handler goSection is the handler use to go from one section in
-- the product to another.
on goSection sectionName, scrollFlag
global sectionMovie, sectionFrame, currentsection
global maxNumButtons
set maxNumButtons = 3
setMouseDownScriptEmpty -- Added by ET Oct. 2, 95
addSectionToBackList(currentsection)
setBackFlag(FALSE)
setSectionButtonCursors("-1") -- reset the cursors of the old section
turnOffPuppet
setCurrentSection(sectionName)
setSectionInfo(sectionName)
resetSpriteCursors -- for a frame in the same movie
removeSectionButtons(1,maxNumButtons)
goMovie(sectionMovie, sectionFrame)
removeVisibleButtons(1,maxNumButtons) -- Added by ET
setUpMenu
placeSectionButtonsOnStage
setOrientation(scrollFlag)
setMenuBackGroundCursor("fingerCursor")
setSectionButtonCursors("fingerCursor")
setSectionNavigationCursors
end
-- Handler setCurrentSection sets the global variable currentSection
-- to the given sectionName. (is this needed?)
on setCurrentSection sectionName
global currentSection
set currentSection = sectionName
end
-- ---------------------------------------------------------------
-- ---------------------------------------------------------------
-- Handler turnOffPuppet
on turnOffPuppet
repeat with i = 1 to 48
puppetSprite i, FALSE
end repeat
end
-- ---------------------------------------------------------------
-- Handler setSectionInfo
on setSectionInfo sectionName
set sectionInfo = getSectionInfo(sectionName)
if sectionInfo = "" then exit
setSectionMovie(sectionInfo)
setSectionFrame(sectionInfo)
setLeftSection(sectionInfo)
setRightSection(sectionInfo)
setTopSection(sectionInfo)
setBottomSection(sectionInfo)
setParentSection(sectionInfo)
setNumSectionButtons(sectionInfo) -- needed to know how many buttons to place on stage
setButtonTextPositions
-- get the text to be placed in the buttons
setButtonTexts(sectionInfo)
-- get the section name to go to when each button is clicked.
setButtonSections(sectionInfo)
setSectionOrientation(sectionInfo)
end
-- ---------------------------------------------------------------
-- Handler goLeft goes to the current section's leftSection.
on goLeft
global leftSection
-- check if the 3T`ent section has a leftSection
if sectionExists(leftSection) then
goSection(leftSection,0)
end if
end
-- ---------------------------------------------------------------
-- Handler goRight goes to the current section's rightSection.
on goRight
global rightSection
-- check if the current section has a leftSection
if sectionExists(rightSection) then
goSection(rightSection,0)
end if
end
-- ---------------------------------------------------------------
-- Handler goTop goes to the current section's topSection.
on goTop
global topSection
-- check if the current section has a topSection
if sectionExists(topSection) then
goSection(topSection,0)
end if
end
-- ---------------------------------------------------------------
-- Handler goBottom goes to the current section's bottomSection.
on goBottom
global bottomSection
-- check if the current section has a bottomSection
if sectionExists(bottomSection) then
goSection(bottomSection,0)
end if
end
-- ---------------------------------------------------------------
-- Handler goParent goes to the current section's parentSection.
on goParent
global parentSection
-- check if the current section has a parentSection
if sectionExists(parentSection) then
goSection(parentSection)
end if
end
-- ---------------------------------------------------------------
-- Handler goButtonSection is called when the user clicks on one of
-- the 3 buttons on the menu bar. It goes to the appropriate section
-- (determined by the global variables button1Section, button2Section
-- and button3Section)
on goButtonSection buttonIndex
global listOfButtonSections
set whichSection = getAt(listOfButtonSections,buttonIndex)
-- check if the clicked button has a goTo section (should be if it is on stage
-- but do this for error checking anyway).
if sectionExists(whichSection) then
if whichSection = "TourSt" then
goTour
else
goSection(whichSection, 1)
end if
end if
end
-- ---------------------------------------------------------------
-- Handler placeSectionButtonsOnStage calls the handler placeButton
-- to place on stage the buttons of the current section.
on placeSectionButtonsOnStage
global numSectionButtons, maxNumButtons
if numSectionButtons then
placeButtonBackGroundOnStage(numSectionButtons)
repeat with i = 1 to numSectionButtons
placeButton(i)
end repeat
--removeSectionButtons(numSectionButtons + 1,maxNumButtons)
--else
--removeButtonBackGroundFromStage
--removeSectionButtons(1,maxNumButtons)
end if
end
-- ---------------------------------------------------------------
-- Handler setSectionButtonCursors calls the handler setButtonCursor
-- to set the cursors of the buttons of the current section.
on setSectionButtonCursors whichCursor
global numSectionButtons, buttonBackGroundSprite
set the cursor of sprite buttonBackGroundSprite = value(whichCursor)
repeat with i = 1 to numSectionButtons
setButtonCursor(i, whichCursor)
end repeat
end
-- ---------------------------------------------------------------
-- Handler removeButtonBackGroundOnStage removes the background
-- of the buttons from the stage
on removeButtonBackGroundFromStage
global buttonBackGroundSprite
set the locH of sprite buttonBackGroundSprite = 1000
set the locV of sprite buttonBackGroundSprite = 1000
updateStage
end
-- ---------------------------------------------------------------
-- Handler removeSectionButtons removes the section button with the
-- given index from the stage
on removeSectionButtons firstButton, lastButton
global listOfbuttonTextSprites
repeat with i = firstButton to lastButton
set buttonSprite = getAt(listOfbuttonTextSprites, i)
if the castNum of sprite buttonSprite > 0 then
set the backcolor of cast the castNum of sprite buttonSprite = 255 -- black
end if
end repeat
if the castNum of sprite buttonSprite > 0 then
removeButtonBackGroundFromStage
end if
end
-- Handler removeVisibleButtons removes the section button with the
-- given index from the stage
on removeVisibleButtons firstButton, lastButton
global listOfbuttonTextSprites
repeat with i = firstButton to lastButton
set buttonSprite = getAt(listOfbuttonTextSprites, i)
set the visible of sprite buttonSprite to FALSE
end repeat
end
-- ---------------------------------------------------------------
-- Handler placeButtonBackGroundOnStage places onstage the correct
-- background for the current section's buttons (cast member with
-- the correct number of buttons)
on placeButtonBackGroundOnStage numSectionButtons
global buttonBackGroundSprite
global listOfButtonHs, listOfButtonVs
puppetSprite buttonBackGroundSprite, TRUE
set the stretch of sprite buttonBackGroundSprite = TRUE
set theCast = the number of cast (numSectionButtons & "Buttons")
set the height of sprite buttonBackGroundSprite = the height of cast theCast
set the width of sprite buttonBackGroundSprite = the width of cast theCast
set the castNum of sprite buttonBackGroundSprite = theCast
set H = getAt(listOfButtonHs,numSectionButtons)
set V = getAt(listOfButtonVs,numSectionButtons)
set the locH of sprite buttonBackGroundSprite = H
set the locV of sprite buttonBackGroundSprite = V
updateStage
end
-- ---------------------------------------------------------------
-- Handler placeButton places the button with the given index on
-- stage. A